﻿import { errorTips } from './utils';
import { t } from '@/lang/index';

export default function httpErrorHandle(code: number) {
    switch (code) {
        case 400:
            errorTips(t('Code.WrongRequest'));
            break;
        case 401:
            errorTips(t('Code.Unauthorized'));
            break;
        case 403:
            errorTips(t('Code.Unauthorized'));
            break;
        case 404:
            errorTips(t('Code.RequestAddress'));
            break;
        case 405:
            errorTips(t('Code.RequestMethod'));
            break;
        case 500:
            errorTips(t('Code.ServerError'));
            break;
        default:
            errorTips(t('Code.ServerError'));
            break;
    }
}
